package website.sgg.simpleFactory;

/**
 * @Author: 582895699@qq.com
 * @Desctription:
 * @Date: Created in 2023/1/11 22:21
 */
public class CarsFactory {
    public static Car getCar(String type) {
        Car car = null;
        if ("ford".equals(type)) {
            car = new Ford();
        } else if ("Ferrari".equals(type)) {
            car = new Ferrari();
        }
        return car;
    }

    public static void main(String[] args) {
        Car ford = CarsFactory.getCar("Ferrari");
        System.out.println(ford.getDescription());
    }
}
